package cn.xfdzx.android.apps.shop.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import butterknife.ButterKnife;
import cn.xfdzx.android.apps.shop.R;

/**
 * @author gzk
 * @date 2020/3/27 0027
 * description：全部订单
 */
public class DistributionInfoMapAdapter extends RecyclerView.Adapter {

    /**
     * 待支付两种
     */
    public static final int TYPE_1 = 0;
    public static final int TYPE_2 = 1;

    private Context mContext;
    private final LayoutInflater mLayoutInflater;

    public DistributionInfoMapAdapter(Context mContext) {
        this.mContext = mContext;


        //以后用它来初始化布局
        mLayoutInflater = LayoutInflater.from(mContext);

    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        if (viewType == TYPE_1) {
            return new DistributionViewHolder0(mContext, mLayoutInflater.inflate(R.layout.item_distribution_info_1, null));
        } else if (viewType == TYPE_2) {
            return new DistributionViewHolder1(mContext, mLayoutInflater.inflate(R.layout.item_distribution_info_2, null));
        }
        return null;
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {


    }

    @Override
    public int getItemViewType(int position) {
        if (position == 0) {
            return TYPE_1;
        } else {
            return TYPE_2;
        }
    }

    @Override
    public int getItemCount() {

        return 2;
    }


    public class DistributionViewHolder0 extends RecyclerView.ViewHolder {

        private Context mContext;

        public DistributionViewHolder0(Context mContext, View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
            this.mContext = mContext;

        }

        private void visibility(int positon) {

        }
    }
        public class DistributionViewHolder1 extends RecyclerView.ViewHolder {
            private Context mContext;

            public DistributionViewHolder1(Context mContext, View itemView) {
                super(itemView);
                ButterKnife.bind(this, itemView);
                this.mContext = mContext;

            }

            public void setData(int position) {


            }

            private void visibility(int positon) {

            }
        }

}
